home *** CD-ROM | disk | FTP | other *** search
/ Champak 86 / (Vol 86) My Disc.iso / Games / restaurante_1072.swf / scripts / __Packages / Table.as < prev    next >
Text File  |  2009-04-16  |  24KB  |  580 lines

  1. if(true)
  2. {
  3.    if(true)
  4.    {
  5.       ┬º┬ºpush(false);
  6.    }
  7.    if(!┬º┬ºpop())
  8.    {
  9.       if(true)
  10.       {
  11.          if(true)
  12.          {
  13.             ┬º┬ºpush(false);
  14.          }
  15.          if(!┬º┬ºpop())
  16.          {
  17.             if(!_global.Table)
  18.             {
  19.                _global.Table extends MissionItem;
  20.                var _loc2_ = _global.Table = function($mc, $data)
  21.                {
  22.                   super($mc);
  23.                   this._status = Table.NOTFULL;
  24.                   this.customers = [];
  25.                   this.initTableData($data);
  26.                   this.__set__status(Table.NOTFULL);
  27.                   var obj = this;
  28.                   this.__get__mc().onMouseUp = function()
  29.                   {
  30.                      obj.onRollOut();
  31.                   };
  32.                }.prototype;
  33.                _global.Table = function($mc, $data)
  34.                {
  35.                   super($mc);
  36.                   this._status = Table.NOTFULL;
  37.                   this.customers = [];
  38.                   this.initTableData($data);
  39.                   this.__set__status(Table.NOTFULL);
  40.                   var obj = this;
  41.                   this.__get__mc().onMouseUp = function()
  42.                   {
  43.                      obj.onRollOut();
  44.                   };
  45.                }.getTableByIJ = function(ii, jj)
  46.                {
  47.                   var _loc2_ = Mission.getMission().__get__tables();
  48.                   var _loc1_ = 0;
  49.                   while(_loc1_ < _loc2_.length)
  50.                   {
  51.                      if(_loc2_[_loc1_].RowNum.i == ii && _loc2_[_loc1_].RowNum.j == jj)
  52.                      {
  53.                         return _loc2_[_loc1_];
  54.                      }
  55.                      _loc1_ = _loc1_ + 1;
  56.                   }
  57.                   return _loc2_[0];
  58.                };
  59.                _loc2_.__get__food = function()
  60.                {
  61.                   return this._food;
  62.                };
  63.                _loc2_.__get__maxNumCustomers = function()
  64.                {
  65.                   return 2;
  66.                };
  67.                _loc2_.__get__deskMc = function()
  68.                {
  69.                   return this.desk;
  70.                };
  71.                _loc2_.__get__customerLeave = function()
  72.                {
  73.                   return this._coustomerLeave;
  74.                };
  75.                _loc2_.__get__rendezvousPoint = function()
  76.                {
  77.                   return {x:this.__get__mc()._x,y:this.__get__mc()._y - 51};
  78.                };
  79.                _loc2_.__get__leftPoint = function()
  80.                {
  81.                   return {x:this.__get__mc()._x - 50,y:this.__get__mc()._y - 25};
  82.                };
  83.                _loc2_.__get__isHappy = function()
  84.                {
  85.                   if(this.customers.length < 2)
  86.                   {
  87.                      return false;
  88.                   }
  89.                   var _loc2_ = 0;
  90.                   while(_loc2_ < this.customers.length)
  91.                   {
  92.                      if(this.customers[_loc2_].numHearts < 5)
  93.                      {
  94.                         return false;
  95.                      }
  96.                      _loc2_ = _loc2_ + 1;
  97.                   }
  98.                   return true;
  99.                };
  100.                _loc2_.__get__isEmpty = function()
  101.                {
  102.                   return this.customers.length <= 0;
  103.                };
  104.                _loc2_.__get__customersArray = function()
  105.                {
  106.                   return this.customers;
  107.                };
  108.                _loc2_.__get__isNotFull = function()
  109.                {
  110.                   return this.__get__status() == Table.NOTFULL;
  111.                };
  112.                _loc2_.__get__isLove = function()
  113.                {
  114.                   return this._isLove;
  115.                };
  116.                _loc2_.__get__rightPoint = function()
  117.                {
  118.                   return {x:this.__get__mc()._x + 50,y:this.__get__mc()._y - 25};
  119.                };
  120.                _loc2_.__get__arrivePoint = function()
  121.                {
  122.                   return {x:this.__get__mc()._x,y:this.__get__mc()._y - 1};
  123.                };
  124.                _loc2_.__get__RowNum = function()
  125.                {
  126.                   return this.row_num;
  127.                };
  128.                _loc2_.__get__numCustomers = function()
  129.                {
  130.                   return this.customers.length;
  131.                };
  132.                _loc2_.__get__cashes = function()
  133.                {
  134.                   return this.cash;
  135.                };
  136.                _loc2_.addCustomer = function(c)
  137.                {
  138.                   var obj = this;
  139.                   this.customers.push(c);
  140.                   c.__get__mc().removeMovieClip();
  141.                   Mission.getMission().__get__door().reduceCustomer(c);
  142.                   c.__set__status(Customer.SIT);
  143.                   c.__set__mc(this.__get__mc().attachMovie(CustomerType.__get__TYPES()[c.__get__type()],"customerMc" + this.__get__numCustomers(),this.__get__mc().getNextHighestDepth()));
  144.                   if(this.__get__numCustomers() == 1)
  145.                   {
  146.                      c.setDirection(Direction.RIGHT);
  147.                   }
  148.                   else if(this.__get__numCustomers() == 2)
  149.                   {
  150.                      c.setDirection(Direction.LEFT);
  151.                      CustomerType.createCouple(this.customers[0],this.customers[1]);
  152.                      var interval = setInterval(function()
  153.                      {
  154.                         if(!obj.__get__isEmpty() && !obj.__get__customerLeave())
  155.                         {
  156.                            obj.__set__status(Table.MENU);
  157.                         }
  158.                         clearInterval(interval);
  159.                      }
  160.                      ,this.menuDelay);
  161.                   }
  162.                   this.desk.swapDepths(this.__get__mc().getNextHighestDepth());
  163.                   c.__get__mc()._x = this.chairs[this.__get__numCustomers() - 1]._x;
  164.                   c.__get__mc()._y = this.chairs[this.__get__numCustomers() - 1]._y;
  165.                };
  166.                _loc2_.getFood = function($food)
  167.                {
  168.                   this._food = $food;
  169.                   this.__set__status(Table.EATING);
  170.                   this.__get__food().__set__mc(this.desk.attachMovie(MissionData.DATA[Mission.getMission().__get__id()].food.linkName,"food",this.desk.getNextHighestDepth()));
  171.                };
  172.                _loc2_.listenMusic = function()
  173.                {
  174.                   var obj = this;
  175.                   this.musicInterval = setInterval(function()
  176.                   {
  177.                      var _loc1_ = 0;
  178.                      while(_loc1_ < obj.customers.length)
  179.                      {
  180.                         Customer(obj.customers[_loc1_]).changeHearts(1);
  181.                         _loc1_ = _loc1_ + 1;
  182.                      }
  183.                   }
  184.                   ,this.musicDelay);
  185.                };
  186.                _loc2_.musicStop = function()
  187.                {
  188.                   var _loc2_ = this;
  189.                   clearInterval(this.musicInterval);
  190.                };
  191.                _loc2_.onRollOver = function()
  192.                {
  193.                   this.__get__mc()._alpha = 50;
  194.                };
  195.                _loc2_.onRollOut = function()
  196.                {
  197.                   this.__get__mc()._alpha = 100;
  198.                };
  199.                _loc2_.customersLeave = function(c)
  200.                {
  201.                   var obj = this;
  202.                   Mission.getMission().__get__kitchen().tableCustomerAngry(obj);
  203.                   var _loc2_ = 0;
  204.                   while(_loc2_ < obj.customers.length)
  205.                   {
  206.                      if(obj.customers[_loc2_] != c)
  207.                      {
  208.                         Customer(obj.customers[_loc2_]).leave(true);
  209.                      }
  210.                      _loc2_ = _loc2_ + 1;
  211.                   }
  212.                   var love = obj.desk.attachMovie("Fire","fire" + getTimer(),obj.desk.getNextHighestDepth(),{_y:10});
  213.                   var _loc6_ = Customer(obj.customers[0]);
  214.                   var _loc5_ = Customer(obj.customers[1]);
  215.                   var _loc8_ = CustomerType.__get__KISSDEPTHS()[_loc6_.__get__type()];
  216.                   var _loc4_ = CustomerType.__get__KISSDEPTHS()[_loc5_.__get__type()];
  217.                   _loc4_ = _loc8_ != _loc4_ ? _loc4_ : _loc8_ + 1;
  218.                   var _loc7_ = CustomerType.__get__TYPES()[_loc6_.__get__type()] + "Angry";
  219.                   var _loc11_ = CustomerType.__get__TYPES()[_loc5_.__get__type()] + "Angry";
  220.                   var _loc10_ = love.attachMovie(_loc7_,_loc7_ + getTimer(),_loc8_);
  221.                   var _loc9_ = love.attachMovie(_loc11_,_loc7_ + getTimer(),_loc4_);
  222.                   _loc10_.gotoAndStop(_loc6_.__get__directionNow());
  223.                   _loc9_.gotoAndStop(_loc5_.__get__directionNow());
  224.                   this._coustomerLeave = true;
  225.                   var interval = setInterval(function()
  226.                   {
  227.                      love.removeMovieClip();
  228.                      var _loc1_ = 0;
  229.                      while(_loc1_ < obj.customers.length)
  230.                      {
  231.                         obj.customers[_loc1_].terminate();
  232.                         _loc1_ = _loc1_ + 1;
  233.                      }
  234.                      obj.customers = [];
  235.                      Mission.getMission().tableCustomersLeave(obj);
  236.                      obj.__set__status(Table.NOTFULL);
  237.                      clearInterval(interval);
  238.                   }
  239.                   ,2000);
  240.                };
  241.                _loc2_.initTableData = function(data)
  242.                {
  243.                   this.desk = this.__get__mc()[data.deskName];
  244.                   this.chairs = [this.__get__mc()[data.chair1Name],this.__get__mc()[data.chair2Name]];
  245.                   this.row_num = {i:data.i,j:data.j};
  246.                   this.musicBtn = MovieClip(this.desk[data.musicName]);
  247.                };
  248.                _loc2_.notFullHandle = function()
  249.                {
  250.                   this.musicBtn.onRelease = null;
  251.                   this._coustomerLeave = false;
  252.                   this._isLove = false;
  253.                   for(var _loc2_ in this.desk)
  254.                   {
  255.                      if(typeof this.desk[_loc2_] == "movieclip")
  256.                      {
  257.                         this.desk[_loc2_].removeMovieClip();
  258.                      }
  259.                   }
  260.                };
  261.                _loc2_.menuHandle = function()
  262.                {
  263.                   var obj = this;
  264.                   var _loc2_ = this.desk.attachMovie("Menu","menu" + getTimer(),this.desk.getNextHighestDepth(),{_x:0,_y:0});
  265.                   _loc2_.onRelease = function()
  266.                   {
  267.                      var _loc2_ = Mission.getMission().__get__waitress();
  268.                      if(!_loc2_.__get__isBusy())
  269.                      {
  270.                         Mission.getMission().__get__waitress().menuService(obj,this);
  271.                      }
  272.                   };
  273.                };
  274.                _loc2_.eatingHandle = function()
  275.                {
  276.                   function eatHalf()
  277.                   {
  278.                      obj._food.__set__status(Food.HALF);
  279.                      clearInterval(interval);
  280.                   }
  281.                   function eatAll()
  282.                   {
  283.                      obj.pay();
  284.                      obj.musicBtn.onRelease = null;
  285.                      obj._food.__set__status(Food.EMPTY);
  286.                      clearInterval(interval2);
  287.                   }
  288.                   var obj = this;
  289.                   var _loc2_ = 0;
  290.                   while(_loc2_ < obj.customers.length)
  291.                   {
  292.                      Customer(obj.customers[_loc2_]).stopLoseHeart();
  293.                      _loc2_ = _loc2_ + 1;
  294.                   }
  295.                   this.musicBtn.onRelease = function()
  296.                   {
  297.                      if(!Mission.getMission().__get__waitress().__get__isBusy())
  298.                      {
  299.                         Mission.getMission().__get__waitress().musicService(obj);
  300.                      }
  301.                   };
  302.                   var interval = setInterval(eatHalf,this.eatDelay / 2);
  303.                   var interval2 = setInterval(eatAll,this.eatDelay);
  304.                };
  305.                _loc2_.pay = function()
  306.                {
  307.                   function love()
  308.                   {
  309.                      obj._isLove = true;
  310.                      var love = obj.desk.attachMovie("Love","love" + getTimer(),obj.desk.getNextHighestDepth(),{_y:10,_xscale:0,_yscale:0});
  311.                      var _loc1_ = new Sound();
  312.                      _loc1_.attachSound("Gita");
  313.                      _loc1_.start();
  314.                      var c1 = Customer(obj.customers[0]);
  315.                      var c2 = Customer(obj.customers[1]);
  316.                      var d1 = CustomerType.__get__KISSDEPTHS()[c1.__get__type()];
  317.                      var d2 = CustomerType.__get__KISSDEPTHS()[c2.__get__type()];
  318.                      d2 = d1 != d2 ? d2 : d1 + 1;
  319.                      var mc1 = CustomerType.__get__TYPES()[c1.__get__type()] + "Kiss";
  320.                      var mc2 = CustomerType.__get__TYPES()[c2.__get__type()] + "Kiss";
  321.                      var _loc4_ = new mx.transitions.Tween(love,"_xscale",mx.transitions.easing.Elastic.easeOut,0,80,1.5,true);
  322.                      var _loc5_ = new mx.transitions.Tween(love,"_yscale",mx.transitions.easing.Elastic.easeOut,0,80,1.5,true);
  323.                      _loc4_.onMotionFinished = function()
  324.                      {
  325.                         var _loc2_ = love.attachMovie(mc1,mc1 + getTimer(),d1,{_xscale:80,_yscale:80});
  326.                         var _loc1_ = love.attachMovie(mc2,mc1 + getTimer(),d2,{_xscale:80,_yscale:80});
  327.                         _loc2_.gotoAndStop(c1.__get__directionNow());
  328.                         _loc1_.gotoAndStop(c2.__get__directionNow());
  329.                      };
  330.                      var interval = setInterval(function()
  331.                      {
  332.                         love.removeMovieClip();
  333.                         allLeave();
  334.                         clearInterval(interval);
  335.                      }
  336.                      ,3000);
  337.                   }
  338.                   function allLeave()
  339.                   {
  340.                      var _loc1_ = 0;
  341.                      while(_loc1_ < obj.customers.length)
  342.                      {
  343.                         obj.customers[_loc1_].terminate();
  344.                         _loc1_ = _loc1_ + 1;
  345.                      }
  346.                      obj._food.__get__mc().onRelease = function()
  347.                      {
  348.                         var _loc1_ = Mission.getMission().__get__waitress();
  349.                         if(!_loc1_.__get__isBusy())
  350.                         {
  351.                            Mission.getMission().__get__waitress().cleanService(obj);
  352.                         }
  353.                      };
  354.                      var _loc2_ = new Sound();
  355.                      _loc2_.attachSound("CashSnd");
  356.                      _loc2_.start();
  357.                      obj.customers = [];
  358.                      Mission.getMission().tableCustomersLeave(obj);
  359.                   }
  360.                   var obj = this;
  361.                   this._coustomerLeave = true;
  362.                   var _loc3_ = Customer.MAXNUMHEARTS;
  363.                   var _loc2_ = 0;
  364.                   while(_loc2_ < this.customers.length)
  365.                   {
  366.                      if(_loc3_ > Customer(this.customers[_loc2_]).__get__numHearts())
  367.                      {
  368.                         _loc3_ = Customer(this.customers[_loc2_]).numHearts;
  369.                      }
  370.                      _loc2_ = _loc2_ + 1;
  371.                   }
  372.                   this.cash = _loc3_ * 100;
  373.                   if(_loc3_ >= Table.NUMHEARTSFORLOVE)
  374.                   {
  375.                      love();
  376.                   }
  377.                   else
  378.                   {
  379.                      allLeave();
  380.                   }
  381.                };
  382.                _loc2_.eattedHandle = function()
  383.                {
  384.                   this.__set__status(Table.NOTFULL);
  385.                };
  386.                _loc2_.toString = function()
  387.                {
  388.                   return "table (" + this.__get__RowNum().i + ", " + this.__get__RowNum().j + "): " + this.__get__mc()._name;
  389.                };
  390.                _global.Table = function($mc, $data)
  391.                {
  392.                   super($mc);
  393.                   this._status = Table.NOTFULL;
  394.                   this.customers = [];
  395.                   this.initTableData($data);
  396.                   this.__set__status(Table.NOTFULL);
  397.                   var obj = this;
  398.                   this.__get__mc().onMouseUp = function()
  399.                   {
  400.                      obj.onRollOut();
  401.                   };
  402.                }.STATUSCHANGEDEVENT = "tableStatusChangedHandle";
  403.                _global.Table = function($mc, $data)
  404.                {
  405.                   super($mc);
  406.                   this._status = Table.NOTFULL;
  407.                   this.customers = [];
  408.                   this.initTableData($data);
  409.                   this.__set__status(Table.NOTFULL);
  410.                   var obj = this;
  411.                   this.__get__mc().onMouseUp = function()
  412.                   {
  413.                      obj.onRollOut();
  414.                   };
  415.                }.NOTFULL = "notFull";
  416.                _global.Table = function($mc, $data)
  417.                {
  418.                   super($mc);
  419.                   this._status = Table.NOTFULL;
  420.                   this.customers = [];
  421.                   this.initTableData($data);
  422.                   this.__set__status(Table.NOTFULL);
  423.                   var obj = this;
  424.                   this.__get__mc().onMouseUp = function()
  425.                   {
  426.                      obj.onRollOut();
  427.                   };
  428.                }.FULL = "full";
  429.                _global.Table = function($mc, $data)
  430.                {
  431.                   super($mc);
  432.                   this._status = Table.NOTFULL;
  433.                   this.customers = [];
  434.                   this.initTableData($data);
  435.                   this.__set__status(Table.NOTFULL);
  436.                   var obj = this;
  437.                   this.__get__mc().onMouseUp = function()
  438.                   {
  439.                      obj.onRollOut();
  440.                   };
  441.                }.MENU = "menu";
  442.                _global.Table = function($mc, $data)
  443.                {
  444.                   super($mc);
  445.                   this._status = Table.NOTFULL;
  446.                   this.customers = [];
  447.                   this.initTableData($data);
  448.                   this.__set__status(Table.NOTFULL);
  449.                   var obj = this;
  450.                   this.__get__mc().onMouseUp = function()
  451.                   {
  452.                      obj.onRollOut();
  453.                   };
  454.                }.WAITFOOD = "waitFood";
  455.                _global.Table = function($mc, $data)
  456.                {
  457.                   super($mc);
  458.                   this._status = Table.NOTFULL;
  459.                   this.customers = [];
  460.                   this.initTableData($data);
  461.                   this.__set__status(Table.NOTFULL);
  462.                   var obj = this;
  463.                   this.__get__mc().onMouseUp = function()
  464.                   {
  465.                      obj.onRollOut();
  466.                   };
  467.                }.EATING = "eating";
  468.                _global.Table = function($mc, $data)
  469.                {
  470.                   super($mc);
  471.                   this._status = Table.NOTFULL;
  472.                   this.customers = [];
  473.                   this.initTableData($data);
  474.                   this.__set__status(Table.NOTFULL);
  475.                   var obj = this;
  476.                   this.__get__mc().onMouseUp = function()
  477.                   {
  478.                      obj.onRollOut();
  479.                   };
  480.                }.EATTED = "eatted";
  481.                _global.Table = function($mc, $data)
  482.                {
  483.                   super($mc);
  484.                   this._status = Table.NOTFULL;
  485.                   this.customers = [];
  486.                   this.initTableData($data);
  487.                   this.__set__status(Table.NOTFULL);
  488.                   var obj = this;
  489.                   this.__get__mc().onMouseUp = function()
  490.                   {
  491.                      obj.onRollOut();
  492.                   };
  493.                }.NUMHEARTSFORLOVE = 5;
  494.                _loc2_._money = 0;
  495.                _loc2_.menuDelay = 2500;
  496.                _loc2_._food = null;
  497.                _loc2_.eatDelay = 20000;
  498.                _loc2_._rendezvousPoint = null;
  499.                _loc2_._arrivePoint = null;
  500.                _loc2_.musicDelay = 3000;
  501.                _loc2_._isLove = false;
  502.                _loc2_.cash = 0;
  503.                _loc2_._coustomerLeave = false;
  504.                ┬º┬ºpush(_loc2_.addProperty("RowNum",_loc2_.__get__RowNum,function()
  505.                {
  506.                }
  507.                ));
  508.                ┬º┬ºpush(_loc2_.addProperty("arrivePoint",_loc2_.__get__arrivePoint,function()
  509.                {
  510.                }
  511.                ));
  512.                ┬º┬ºpush(_loc2_.addProperty("cashes",_loc2_.__get__cashes,function()
  513.                {
  514.                }
  515.                ));
  516.                ┬º┬ºpush(_loc2_.addProperty("customerLeave",_loc2_.__get__customerLeave,function()
  517.                {
  518.                }
  519.                ));
  520.                ┬º┬ºpush(_loc2_.addProperty("customersArray",_loc2_.__get__customersArray,function()
  521.                {
  522.                }
  523.                ));
  524.                ┬º┬ºpush(_loc2_.addProperty("deskMc",_loc2_.__get__deskMc,function()
  525.                {
  526.                }
  527.                ));
  528.                ┬º┬ºpush(_loc2_.addProperty("food",_loc2_.__get__food,function()
  529.                {
  530.                }
  531.                ));
  532.                ┬º┬ºpush(_loc2_.addProperty("isEmpty",_loc2_.__get__isEmpty,function()
  533.                {
  534.                }
  535.                ));
  536.                ┬º┬ºpush(_loc2_.addProperty("isHappy",_loc2_.__get__isHappy,function()
  537.                {
  538.                }
  539.                ));
  540.                ┬º┬ºpush(_loc2_.addProperty("isLove",_loc2_.__get__isLove,function()
  541.                {
  542.                }
  543.                ));
  544.                ┬º┬ºpush(_loc2_.addProperty("isNotFull",_loc2_.__get__isNotFull,function()
  545.                {
  546.                }
  547.                ));
  548.                ┬º┬ºpush(_loc2_.addProperty("leftPoint",_loc2_.__get__leftPoint,function()
  549.                {
  550.                }
  551.                ));
  552.                ┬º┬ºpush(_loc2_.addProperty("maxNumCustomers",_loc2_.__get__maxNumCustomers,function()
  553.                {
  554.                }
  555.                ));
  556.                ┬º┬ºpush(_loc2_.addProperty("numCustomers",_loc2_.__get__numCustomers,function()
  557.                {
  558.                }
  559.                ));
  560.                ┬º┬ºpush(_loc2_.addProperty("rendezvousPoint",_loc2_.__get__rendezvousPoint,function()
  561.                {
  562.                }
  563.                ));
  564.                ┬º┬ºpush(_loc2_.addProperty("rightPoint",_loc2_.__get__rightPoint,function()
  565.                {
  566.                }
  567.                ));
  568.                ┬º┬ºpush(ASSetPropFlags(_global.Table.prototype,null,1));
  569.             }
  570.             ┬º┬ºpop();
  571.          }
  572.       }
  573.       ┬º┬ºgoto(addr1625);
  574.    }
  575.    ┬º┬ºpush(┬º┬ºpop()[function ┬º\x1b∩┐╜\x02┬º(┬º∩┐╜\x07┬º, ┬º\x01┬º, ┬º\x02\x01┬º, ┬º\x01┬º, ┬º∩┐╜∩┐╜∩┐╜\x07∩┐╜∩┐╜\x07∩┐╜┬º, _global, Table, _status, NOTFULL, customers, initTableData, __set__status, obj, __get__mc)
  576.    {
  577.    }]);
  578. }
  579. addr1625:
  580.